﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Comsenz.Services.Blocks.Configs
{
    /// <summary>
    /// 可设置和接收的参数集
    /// </summary>
    /// <author>Chiron</author>
    public class BlockGetSettings : Dictionary<string, BlockGetSetting>
    {
        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="title">显示的名称</param>
        /// <param name="type">表单类型</param>
        /// <param name="defaultValue">默认值</param>
        /// <param name="values">可选值</param>
        public void Add(string key, string title, InputType type, object defaultValue, SettingValues values)
        {
            Add(key, new BlockGetSetting(title, type, defaultValue, values));
        }
        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="title">显示的名称</param>
        /// <param name="type">表单类型</param>
        /// <param name="defaultValue">默认值</param>
        public void Add(string key, string title, InputType type, object defaultValue = null)
        {
            Add(key, title, type, defaultValue, null);
        }
        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="title">显示的名称</param>
        /// <param name="type">表单类型</param>
        /// <param name="values">可选值</param>
        public void Add(string key, string title, InputType type, SettingValues values)
        {
            Add(key, title, type, null, values);
        }
        /// <summary>
        /// 添加参数
        /// </summary>
        /// <param name="key">键</param>
        /// <param name="title">显示的名称</param>
        /// <param name="type">表单类型</param>
        public void Add(string key, string title, InputType type = InputType.text)
        {
            Add(key, title, type, null, null);
        }
    }
}
